package com.fingard.dsp.bank.reqrespobj.elecbillquery;

import com.fingard.dsp.bank.reqrespobj.ReqRespHeader;
import com.fingard.dsp.bank.reqrespobj.RetAtsBase;
import com.fingard.dsp.bank.reqrespobj.elecbillquery.detail.RetAtsB007BillKzsrQryDetail;
import com.fingard.xml.XmlTextWriter;

/**
 * Created by dell on 2017/10/1.
 */
public class RetAtsB007BillKzsrQry extends RetAtsBase {

    public String respCode;
    public String respInfo;
    public String billNo;

    public RetAtsB007BillKzsrQry(ReqRespHeader p_header) {
        retHeader = p_header;
        retXmlWriter = new XmlTextWriter();//用于输出返回ATS的XML报文
    }

    public void writeBeforeDetail() {
        writeStart();
    }

    public void writeRespInfos() {
        retXmlWriter.writeElementString("RespCode", respCode);
        retXmlWriter.writeElementString("RespInfo", respInfo);
        retXmlWriter.writeElementString("BillNo", billNo);
    }

    public void writeAfter() {
        writeEnd();
    }

    private boolean writtenBefore = false;

    public void writeDetail(RetAtsB007BillKzsrQryDetail DB007Resp) {
        retXmlWriter.writeStartElement("DetailRecord");
        retXmlWriter.writeElementString("ReceName", DB007Resp.receName);
        retXmlWriter.writeElementString("ReceCode", DB007Resp.receCode);
        retXmlWriter.writeElementString("ReceAct", DB007Resp.receAct);
        retXmlWriter.writeElementString("ReceBnkName", DB007Resp.receBnkName);
        retXmlWriter.writeElementString("ReceBnkCode", DB007Resp.receBnkCode);
        retXmlWriter.writeEndElement();
    }
}
